<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>对象属性迭代</title>
</head>
<body>
<script>
function Person() {
    this.name = "Alice"
    this.age = 100
}
Person.prototype.num = 100



let person = new Person()

Object.defineProperty(person,'order',{
    enumerable:false,
    value:"001"
})
/*只会看当前对象*/
console.log(person.hasOwnProperty('num'));
/*会看原型 for in也是 但只会返回可以被访问的属性*/
console.log('num' in person)
/*当前对象所有可以遍历的属性*/
console.log(Object.keys(person))
/*当前对象所有的属性*/
console.log(Object.getOwnPropertyNames(person));

for (let personKey in person) {
    console.log(personKey)
}



</script>
</body>
</html>